home *** CD-ROM | disk | FTP | other *** search
- Path: mother.usf.edu!suntan!cdiaz
- From: "Carlos Diaz (CS)" <cdiaz@eng.usf.edu>
- Newsgroups: comp.lang.c
- Subject: #include "" for large programs.
- Date: Thu, 11 Apr 1996 20:05:59 -0400
- Organization: University of South Florida
- Message-ID: <Pine.SUN.3.92.960411195730.24973A-100000@suntan>
- NNTP-Posting-Host: suntan.eng.usf.edu
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- X-Sender: cdiaz@suntan
-
- Hello!
- I've been writing short two part programs using the #include "filename"
- preprocessor.
- I call one file main.c and the other part2.c, for which there is a
- prototype header file part2.h.
- All works well when I compile the programs, except when part2.h has
- #define constants (I've been advised by my professor to use #define for
- constants over 'const type var_name'). My compiler returns a fatal error
- reporting that the symbol in the #define is not defined.
- For example if #define EQUAL 0 is part of part2.h, I'm told that the
- symbol EQUAL is not defined. But if I put the #define inside main.c, I'm
- told that I've defined EQUAL TWICE, once in part2.h and again within
- main. The book we're using in class is not helping at all in this subject,
- and I cannot figure out why everything else is recognized, except #define
- constants. Can anyone here help? If the answer to this is in the FAQ, just
- tell me where to download it from. Thanks!
-
- -Carlos E. Diaz
-
-
-